<!DOCTYPE html>
{% capture pagelang %}{% if page.lang %}{{page.lang}}{% else %}en{% endif %}{% endcapture %}
{% assign msg = site.data[pagelang][pagelang]  %}
{% capture amazon %}{% if site.amazon[pagelang]%}{{site.amazon[pagelang]}}{% else %}{{site.amazon.en}}{% endif %}{% endcapture %}
{% capture screenshotdir %}{% if page.screenshots_missing%}/en/screenshots/{% else %}screenshots/{% endif %}{% endcapture %}

<html lang="{{pagelang}}">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="My Expenses, Open Source Android App for personal finance management">
    <meta name="author" content="Michael Totschnig">
    <!-- <a href="https://plus.google.com/116736113799210525299" rel="publisher">Google+</a> -->
    <title>{{site.title[pagelang]}}</title>

    <!-- Bootstrap core CSS -->
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.11.5/css/lightbox.min.css" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link href="/css/jumbotron-narrow.css" rel="stylesheet">
    <link href="/css/styles.css" rel="stylesheet">
    <link href="/css/bootstrap_ms.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="/script/html5shiv.js"></script>
      <script src="/script/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>
    <div class="container">
      <div class="header">
        <ul class="nav nav-pills pull-right">
          <li><a href="https://mastodon.social/@myexpenses">News</a></li>
          <li><a href="https://github.com/mtotschnig/MyExpenses/wiki/FAQ">FAQ</a></li>
          <li id="menu-moreinfo" class="dropdown">
            <a class="dropdown-toggle" data-toggle="dropdown" href="#" title="{% if msg.menu_title.more_information %}{{msg.menu_title.more_information}}{% else %}{{site.data.en.en.menu_title.more_information}}{% endif %}"><span class="glyphicon glyphicon-info-sign"></span><span class="caret"></span>
            </a>
            <ul id="navigation" class="dropdown-menu">
            {% for section in site.sections %}
              <li id="{{section}}-link"><a class="intern" href="#{{section}}">{% if msg.sections[section] %}{{msg.sections[section]}}{% else %}{{site.data.en.en.sections[section]}}{% endif %}</a></li>
            {% endfor %}
            </ul>
          </li>
          <li class="dropdown">
            <a class="dropdown-toggle" data-toggle="dropdown" href="#">
              {{site.langs[pagelang]}} <span class="caret"></span>
            </a>
            <ul class="dropdown-menu">
              {% for lang in site.langs %}
              {% assign code = lang[0] %}
              {% assign label = lang[1] %}
              {% if code != pagelang %}
              <li><a class="lang_switch" href="/{{code}}">{{label}}</a></li>
              {% endif %}
              {% endfor %}
            </ul>
          </li>
        </ul>
        <h3 class="text-muted"><img height="48" width="48" src="/visuals/icon_96.png" /> {{site.title[pagelang]}}</h3>
      </div> <!-- /header-->
      <div class="jumbotron">
        <p>{% if msg.hero_main %}{{msg.hero_main}}{% else %}{{site.data.en.en.hero_main}}{% endif %}</p>
        <span class="btn btn-primary">{% if msg.hero_sub.use %}{{msg.hero_sub.use}}{% else %}{{site.data.en.en.hero_sub.use}}{% endif %}</span>
        <span class="btn btn-primary">{% if msg.hero_sub.functionality %}{{msg.hero_sub.functionality}}{% else %}{{site.data.en.en.hero_sub.functionality}}{% endif %}</span>
        <span class="btn btn-primary">{% if msg.hero_sub.source %}{{msg.hero_sub.source}}{% else %}{{site.data.en.en.hero_sub.source}}{% endif %}</span>
      </div> <!-- /jumbotron -->
      <div class="well">
        <div class="row">
          <div class="col-xs-12 col-ms-6 col-sm-6 play-logo">
            {% case pagelang %}
            {% when 'ar' %}
            <a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='احصل عليه من Google Play ' src='https://play.google.com/intl/de_de/badges/images/generic/ar_badge_web_generic.png'/></a>
			{% when 'fr' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Disponible sur Google Play' src='https://play.google.com/intl/de_de/badges/images/generic/fr_badge_web_generic.png'/></a>
			{% when 'de' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Jetzt bei Google Play' src='https://play.google.com/intl/de_de/badges/images/generic/de_badge_web_generic.png'/></a>
			{% when 'it' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Disponibile su Google Play' src='https://play.google.com/intl/de_de/badges/images/generic/it_badge_web_generic.png'/></a>
			{% when 'es' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Disponible en Google Play' src='https://play.google.com/intl/de_de/badges/images/generic/es_badge_web_generic.png'/></a>
			{% when 'ca' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Disponible a Google Play' src='https://play.google.com/intl/de_de/badges/images/generic/ca_badge_web_generic.png'/></a>
			{% when 'tr' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt="'Google Play'den alın'" src='https://play.google.com/intl/de_de/badges/images/generic/tr_badge_web_generic.png'/></a>
			{% when 'vi' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Tải nội dung trên Google Play' src='https://play.google.com/intl/de_de/badges/images/generic/vi_badge_web_generic.png'/></a>
			{% when 'hu' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Szerezd meg: Google Play' src='https://play.google.com/intl/de_de/badges/images/generic/hu_badge_web_generic.png'/></a>
			{% when 'zh-tw' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Google Play立即下載' src='https://play.google.com/intl/de_de/badges/images/generic/zh-tw_badge_web_generic.png'/></a>
			{% when 'pt' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Disponível no Google Play' src='https://play.google.com/intl/de_de/badges/images/generic/pt_badge_web_generic.png'/></a>
			{% when 'pl' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='pobierz z Google Play' src='https://play.google.com/intl/de_de/badges/images/generic/pl_badge_web_generic.png'/></a>
			{% when 'cs' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Nyní na Google Play' src='https://play.google.com/intl/de_de/badges/images/generic/cs_badge_web_generic.png'/></a>
			{% when 'ru' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Доступно в Google Play' src='https://play.google.com/intl/de_de/badges/images/generic/ru_badge_web_generic.png'/></a>
			{% when 'ro' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='acum pe Google Play' src='https://play.google.com/intl/de_de/badges/images/generic/ro_badge_web_generic.png'/></a>
			{% when 'ja' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Google Play で手に入れよう' src='https://play.google.com/intl/de_de/badges/images/generic/ja_badge_web_generic.png'/></a>
			{% when 'ms' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Dapatkan di Google Play' src='https://play.google.com/intl/de_de/badges/images/generic/ms_badge_web_generic.png'/></a>
			{% when 'hr' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Dostupno na usluzi Google Play' src='https://play.google.com/intl/de_de/badges/images/generic/hr_badge_web_generic.png'/></a>
			{% when 'eu' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Lortu Google Play dendan' src='https://play.google.com/intl/de_de/badges/images/generic/eu_badge_web_generic.png'/></a>
			{% when 'da' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Nu på Google Play' src='https://play.google.com/intl/de_de/badges/images/generic/da_badge_web_generic.png'/></a>
			{% when 'bg' %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Предлага се в Google Play' src='https://play.google.com/intl/de_de/badges/images/generic/bg_badge_web_generic.png'/></a>
		    {% else %}
			<a href='https://play.google.com/store/apps/details?id=org.totschnig.myexpenses&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' src='https://play.google.com/intl/de_de/badges/images/generic/en_badge_web_generic.png'/></a>
			{% endcase %}
          </div>
          <div class="col-xs-12 col-ms-6 col-sm-6 fdroid-logo">
            <a id="fdroid" href="https://f-droid.org/repository/browse/?fdid=org.totschnig.myexpenses">
              <img alt="Get it on F-Droid" src="/visuals/getitonfdroid.png" />
            </a>
          </div>
        </div> <!-- /row -->
        <div class="row">
          <div class="col-xs-12 col-ms-6 col-sm-6">
            <a id="amazon" href="http://{{amazon}}/gp/product/B00FEFVFOQ?ref=mas_pm_MyExpenses">
              <img alt="Get it on Amazon" src="/visuals/amazon-apps-store-{% if pagelang == "es" or pagelang == "de" or pagelang == "fr" or pagelang == "it" %}{{pagelang}}{% else %}en{% endif %}-black.png" />
            </a>
          </div>
          <div class="col-xs-12 col-ms-6 col-sm-6">
            <a id="huawei" href="https://appgallery.cloud.huawei.com/appDetail?pkgName=org.totschnig.myexpenses&channelId=website&detailType=0&callType=AGDLINK">
              <img alt="Get it on Huawei AppGallery" src="/visuals/huawei-{% if pagelang == "ar" or pagelang == "bg" or pagelang == "cs" or pagelang == "el" or pagelang == "es" or pagelang == "fr" or pagelang == "hr" or pagelang == "hu" or pagelang == "it" or pagelang == "ja" or pagelang == "ko" or pagelang == "ms" or pagelang == "pl" or pagelang == "pt" or pagelang == "ru" or pagelang == "tr" or pagelang == "uk" %}{{pagelang}}{% else %}en{% endif %}.png" />
            </a>
          </div>
        </div> <!-- /row -->
      </div> <!-- /well -->
      <div id="features" class="block">
        <nav>
        <ul>
          {% for feature in site.features %}
          <li><a class="featuretoc{% if forloop.index0 == 0 %} active{% endif %}" href="#{{feature}}">{% if msg.screenshots[feature] %}{{msg.screenshots[feature]}}{% else %}{{site.data.en.en.screenshots[feature]}}{% endif %}</a>
                    <article id="{{feature}}" class="target{% if forloop.index0 == 0 %} active{% endif %}">
            <figure>
             <a href="{{screenshotdir}}{{feature}}.webp" data-lightbox="features" data-title="{% if msg.screenshots[feature] %}{{msg.screenshots[feature]}}{% else %}{{site.data.en.en.screenshots[feature]}}{% endif %}">
              <img src="{{screenshotdir}}{{feature}}_25.webp" >
              </a>
            </figure>
          </article>
          </li>
          {% endfor %}
       </ul>
       </nav>
      </div> <!-- /features -->
      {{content}}
      {% include misc_info.html %}
      <div class="footer">
        © 2023 Michael Totschnig - <a class="intern" href="#imprint">{% if msg.imprint %}{{msg.imprint}}{% else %}{{site.data.en.en.imprint}}{% endif %}</a> - <a href="mailto:{{site.support-email}}">Feedback</a>
      </div>
      <div style="text-align:center">
        <div class="fb-like" data-href="https://www.facebook.com/MyExpenses" data-width="" data-layout="standard" data-action="like" data-size="small" data-share="true"></div>
      </div>
      <p id="back-top" style="display:none">
        <a href="#top"><span></span>Top</a>
      </p>
    </div> <!-- /container -->


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/lightbox2/2.11.5/js/lightbox.min.js"></script>
    <script type="text/javascript">

      $(document).ready(function(){
        // Credits: http://webdesignerwall.com/tutorials/animated-scroll-to-top

        // fade in #back-top
        $(function () {
          $(window).scroll(function () {
            if ($(this).scrollTop() > 100) {
              $('#back-top').fadeIn();
            } else {
              $('#back-top').fadeOut();
            }
          });

          // scroll body to 0px on click
          $('#back-top a').click(function () {
            $('body,html').animate({
              scrollTop: 0
            }, 800);
            $(this).blur();
            return false;
          });
        });
        mkActive(location.hash);

      })
     $('a.lang_switch').click(function(event){
        this.hash = location.hash;
      });
      $('a.intern').click(function(event){
        event.preventDefault(); 
        mkActive(this.hash);
        history.pushState(null, null, this.href);
      });
      //we need to prevent links from the FAQ TOC to the FAQ entries
      //to be recorded in history, since this triggers the popstate eventlistener
      $('.qandaset a').click(function(event){
        event.preventDefault();
        $('html, body').animate({
          scrollTop: $(this.hash).offset().top
        }, 'slow');
      });
      $('.featuretoc').click(function(event){
        event.preventDefault();
        if ($(this).hasClass("active")) {
          $(this).removeClass("active");
          $(this.hash).removeClass("active");
        } else {
          $('.featuretoc.active').removeClass("active");
          $('article.active').removeClass("active");
          $(this).addClass("active");
          $(this.hash).addClass("active");
        }
      });
      //target is hash + id of block  
      function mkActive(target) {
        var block;
        var doScroll = true;
        if (target=='') {
          block = '#features';
          doScroll=false;
        } else {
          block=target.split("-")[0];
        }
        //when called with non existent hash do nothing
        if ($(block).length == 0) return;
        $('.block').toggle(false);
        $(block).toggle(true);
        var targetTitle = $(block + " h2").text();
        document.title = "{{site.title[pagelang]}}" + (targetTitle == "" ? "" : (" | " +targetTitle));
        $('#navigation').find('li.active').first().removeClass('active');
        $(block+"-link").addClass('active');

        if (doScroll) {
          $('html, body').animate({
            scrollTop: $(target).offset().top
          }, 'slow');
        }
      }
      /*
      * http://stackoverflow.com/a/12214354/1199911
      * Necessary hack because WebKit fires a popstate event on document load
      * https://code.google.com/p/chromium/issues/detail?id=63040
      * https://bugs.webkit.org/process_bug.cgi
      */
      window.addEventListener('load', function() {
        setTimeout(function() {
          window.addEventListener('popstate', function() {
             mkActive(location.hash);
          });
        }, 0);
      });
    </script>
  </body>
</html>
